﻿#ifndef CPUINFO_H
#define CPUINFO_H

#include <QBaseEntity>

class CpuInfo : public QBaseEntity
{
    Q_OBJECT
    // 定义属性
    Q_PROPERTY(QString model READ getModel WRITE setModel)
    Q_PROPERTY(QString vendor READ getVendor WRITE setVendor)
    Q_PROPERTY(QString architecture READ getArchitecture WRITE setArchitecture)
    Q_PROPERTY(int physicalCores READ getPhysicalCores WRITE setPhysicalCores)
    Q_PROPERTY(int logicalCores READ getLogicalCores WRITE setLogicalCores)
    Q_PROPERTY(QString cacheSize READ getCacheSize WRITE setCacheSize)
    Q_PROPERTY(QString maxFrequency READ getMaxFrequency WRITE setMaxFrequency)
    Q_PROPERTY(QString minFrequency READ getMinFrequency WRITE setMinFrequency)
public:
    explicit CpuInfo(QObject *parent = nullptr);

    QString getModel() const;
    void setModel(const QString &value);

    QString getVendor() const;
    void setVendor(const QString &value);

    QString getArchitecture() const;
    void setArchitecture(const QString &value);

    int getPhysicalCores() const;
    void setPhysicalCores(int value);

    int getLogicalCores() const;
    void setLogicalCores(int value);

    QString getCacheSize() const;
    void setCacheSize(const QString &value);

    QString getMaxFrequency() const;
    void setMaxFrequency(const QString &value);

    QString getMinFrequency() const;
    void setMinFrequency(const QString &value);

private:
    QString model;
    QString vendor;
    QString architecture;
    int physicalCores;
    int logicalCores;
    QString cacheSize;
    QString maxFrequency;
    QString minFrequency;
};

#endif // CPUINFO_H
